#ifndef QMISSIONMANAGER_H
#define QMISSIONMANAGER_H

#include <QObject>
#include <QMap>

class QMission;
struct tagDriverDataInfo;

class QMissionManager : public QObject
{
    Q_OBJECT
public:
    explicit QMissionManager(QObject *parent = 0);
    ~QMissionManager();
    
    void    set_max_read(int read);
    void    set_max_write(int write);

    QString add_mission(tagDriverDataInfo *info);
    void    remove_mission(const QString &uuid);
    void    delete_mission(const QString &uuid);

    QMission* get_need_todo();

    QMission* get_mission(const QString &id);
    QList<QMission*>    get_missions();

    void    update_send();

    void    clear();
signals:
    
public slots:
protected:
    QList<QMission*>    m_missions;
    QMap<QString,QMission*>     m_id_to_mission;
    int                 m_max_read;
    int                 m_max_write;
};

#endif // QMISSIONMANAGER_H
